package com.linkgie.galaxyframework.utils;

public class DataPagination implements Pagination {

    private long pageIndex;

    private long pageSize;

    private Long totalSize;

    public DataPagination(PageNo pageNo) {
        this(pageNo.getPageIndex(), pageNo.getPageSize(), null);
    }

    public DataPagination(PageNo pageNo, Long totalSize) {
        this(pageNo.getPageIndex(), pageNo.getPageSize(), totalSize);
    }

    public DataPagination(long pageIndex, long pageSize) {
        this(pageIndex, pageSize, null);
    }

    public DataPagination(long pageIndex, long pageSize, Long totalSize) {
        this.pageIndex = pageIndex;
        this.pageSize = pageSize;
        this.totalSize = totalSize;
    }

    @Override
    public long getPageIndex() {
        return this.pageIndex;
    }

    @Override
    public long getPageSize() {
        return this.pageSize;
    }

    @Override
    public long getTotalSize() {
        return this.totalSize;
    }

}
